<script>
import { h, inject } from 'vue';
import { theme } from 'ant-design-vue';
export default {
    props: ['config'],
    setup(props) {
        const { token } = theme.useToken();
        const StateEvent = inject('StateEvent');
        var RuleConfig = StateEvent.GetRuleType(props.config.type);
        return () => {
            if (RuleConfig.EmptyType == 'PageEmpty') {
                return h('div', { class: 'PageEmpty', })
            } else {
                return h('div', {
                    class: 'BoxEmpty',
                    style: {
                        color: token.value.colorTextTertiary,
                        backgroundColor: token.value.colorBorderSecondary,
                        borderColor: token.value.colorBorder,
                    }
                }, '拖拽组件或模版到这里')
            }
        }
    }
}
</script>

<style lang="less" scoped>
.BoxEmpty {
    width: 100%;
    min-height: 60px;
    text-align: center;
    line-height: 60px;
    border: 1px solid;
    font-size: 14px;
    font-weight: normal;
}

.PageEmpty {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    background-image: url(./Page-Empty.png);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 50% cover;
}
</style>